function DatabaseEntryTest(name) 
{	
	this.base = TestCase;
	this.base(name);
	this.className = "DatabaseEntryTest";
}
DatabaseEntryTest.prototype = new TestCase;

var database, date, testResource, testProperty, 
	testLiteral, anonResource;

DatabaseEntryTest.testing = function () { return [ "file:///home/dafyddj/src/takecontrol/trunk/components/TakeControlService.js" ]; }

DatabaseEntryTest.prototype.setUp = function()
{
	database = new Database();
	date = new Date(2006, 2, 28).getW3CDate();
	testResource = Database.rdf.GetResource("TEST_RESOURCE");
	testProperty = Database.rdf.GetResource("TEST_PROP");
	testLiteral10 = Database.rdf.GetIntLiteral(10);
	testLiteral50 = Database.rdf.GetIntLiteral(50);
	anonResource = Database.rdf.GetAnonymousResource();	
}

DatabaseEntryTest.prototype.testAddAndContains = function () {
	var entry = new DatabaseEntry(testResource, database._ds);
	entry.add(anonResource);
	assertTrue(entry.contains(anonResource));
}

DatabaseEntryTest.prototype.testContainsByProperty_Exists = function () {
	var entry = new DatabaseEntry(testResource, database._ds);
	database._ds.Assert(anonResource, testProperty, testLiteral10, true);
	entry.add(anonResource);	
	assertNotNull(entry.containsByProperty(testProperty, testLiteral10));
}

DatabaseEntryTest.prototype.testContainsByProperty_NonExistant = function () {
	var entry = new DatabaseEntry(testResource, database._ds);
	assertNull(entry.containsByProperty(testProperty, testLiteral50));
	
	database._ds.Assert(anonResource, testProperty, testLiteral10, true);
	entry.add(anonResource);	
	assertNull(entry.containsByProperty(testProperty, testLiteral50));
}
